<!DOCTYPE html>
<html class="no-js" lang="zh_CN">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
    <title>${system_admin_title}</title>
    #required_css
</head>
<body>
#loading
<div class="app $!layout">
    <!-- 头部菜单 -->
    #header
    <section class="layout">
        <!-- 菜单 -->
        #sidebar
        <!-- 内容主体 -->
        <section class="container">
            <section class="main-content">
                <!-- 主体操作栏 -->
                <header class="header navbar">
                    <!-- 左按钮区 -->
                    <div class="btn-group tool-button">
                        <a href="${action}/add" class="btn btn-primary navbar-btn"><i class="ti-plus"></i> 新增</a>
                    </div>
                    <div class="pull-right offscreen-right">
                    </div>
                </header>
                <div class="content-wrap">
                    <div class="wrapper">
                        <form id="${classNameLower}Form" action="${action}" method="post">
                            <div class="row">
                                <div class="col-lg-12 table-responsive">
                                    <table id="${classNameLower}Table" class="table no-m">
                                        <thead>
                                        <tr>
                                            #foreach($!column in $!columns.entrySet())
                                            #set($v = $!column.value)
                                            <th class="col-md-1">${v.get("displayName")}</th>
                                            #end
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        #set($f="_foreach($obj in $list)")
                                        #set($fe='_end')
                                        $!f.replace("_","#")
                                        <tr>
                                            #foreach($!column in $!columns.entrySet())
                                            #set($v = $!column.value)
                                            #set($k = "_!obj."+${v.get("lowerName")})
                                            <td>${k.replace("_","$")}</td>
                                            #end
                                            <td>
                                                <div class="btn-group">
                                                    <button type="button" class="btn btn-default btn-xs dropdown-toggle"
                                                            data-toggle="dropdown">
                                                        <i class="ti-settings"></i>
                                                        <span class="ti-angle-down"></span>
                                                    </button>
                                                    <ul class="dropdown-menu" role="menu">
                                                        <li><a href="${action}/edit/${obj.id}">修改</a></li>
                                                        <li><a href="javascript:;" onclick="del('${obj.id}')">删除</a></li>
                                                        <li class="divider"></li>
                                                    </ul>
                                                </div>
                                            </td>
                                        </tr>
                                        $!fe.replace("_","#")
                                        </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-12">
                                    #pager_ajax
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <a class="exit-offscreen"></a>
            </section>
        </section>
    </section>
</div>
#required_js
<script type="text/javascript">
    ns.requireJS("/framework/js/view/toast.js");
    function del(id) {
        ns.tip.confirm("确定删除吗？", function () {
            ns.post("${action}/delete/" + id, {}, function (success, data) {
                if (success) {
                    //ns.tip.toast.success("删除成功！");
                    ns.back("${action}", 1000);
                } else {
                    ns.tip.toast.error(data.message);
                }
            });
        });
    }
</script>
#loading_close
</body>
</html>
